parse_dns_name(unsigned char* chunk, unsigned char* ptr, char* out, int* len)
{// addr = 0x0804E008
    int n;
    int flag;
    char* pos;
    char* _v8;
    int _v12;
    signed int _v16;
    _unknown_ _v32;
    _unknown_ _v36;
    _unknown_ _v40;
    _unknown_ r6;
    int _t52;
    _unknown_ _t56;
    _unknown_ _t65;

    _v8 =  &(out[ *len]);
    while(1) {
        _v12 =  *ptr & 255 & 255;
        if(_v12 == 0) {
            break;
        }
        _t52 = is_pointer(_v12);
        if(_t52 == 0) {
            ptr =  &(ptr[1]);
            L0806F9E0(__edi, __esi, _v8, ptr, _v12);
            _v8 =  &(_v8[_v12]);
            ptr =  &(ptr[_v12]);
             *len =  *len + _v12;
            if(( *ptr & 255) == 0) {
                continue;
            } else {
                goto L6;
            }
            continue;
        }
        _v16 = (ptr[1]) & 255 & 255;
        ptr =  &(chunk[_v16]);
        parse_dns_name(chunk, ptr, out, len);
        return;
L6:
        L0806F9E0(__edi, __esi, _v8, ".", 1);
        _v8 =  &(_v8[1]);
         *len =  *len + 1;
    }
    return ;
}